package it.amicosmanettone.whatsimage;

import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;

public class InformationActivity extends Activity {
	
	Button buttonFacebook;
	Button buttonTwitter;
	Button buttonGoogle;
	Button buttonAmicosmanettone;
	TextView textHead;
	TextView textBottom;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_information);
		
		Typeface moon = Typeface.createFromAsset(getAssets(), "moon.ttf");
		
		this.buttonFacebook = (Button) findViewById(R.id.buttonFacebook);
		this.buttonTwitter = (Button) findViewById(R.id.buttonTwitter);
		this.buttonGoogle = (Button) findViewById(R.id.buttonGoogle);
		this.buttonAmicosmanettone = (Button) findViewById(R.id.buttonAmicosmanettone);
		this.textHead = (TextView) findViewById(R.id.textInformationHead);
		this.textBottom = (TextView) findViewById(R.id.textInformationBottom);
		
		textHead.setText(getText(R.string.app_name).toString() + "\n\r" + getText(R.string.app_version).toString());
		textHead.setTypeface(moon);
		textHead.refreshDrawableState();
		
		this.buttonFacebook.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				
				String urlFacebook = Configuration.FACEBOOK_URL;
				Intent i = new Intent(Intent.ACTION_VIEW);
				i.setData(Uri.parse(urlFacebook));
				startActivity(i);
				
			}
		});
		
		this.buttonTwitter.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				
				String urlTwitter = Configuration.TWITTER_URL;
				Intent i = new Intent(Intent.ACTION_VIEW);
				i.setData(Uri.parse(urlTwitter));
				startActivity(i);
				
			}
		});
		
		this.buttonGoogle.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				
				String urlGoogle = Configuration.GOOGLE_URL;
				Intent i = new Intent(Intent.ACTION_VIEW);
				i.setData(Uri.parse(urlGoogle));
				startActivity(i);
				
			}
		});
		
		this.buttonAmicosmanettone.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				
				String urlAmicosmanettone = Configuration.AMICOSMANETTONE_URL;
				Intent i = new Intent(Intent.ACTION_VIEW);
				i.setData(Uri.parse(urlAmicosmanettone));
				startActivity(i);
				
			}
		});
		
		
	}

}
